<!DOCTYPE html>
<html lang="en">
    <head>
        @include('front.layouts.head',['title'=>'profile | E-Shopper'])
    </head>
    <!--/head-->
    <body>
        @include('front.layouts.header')
        <div class="container">
            <div class="row">
                <div class="col-md-3">
                    @include('front.layouts.sidebar')
                </div>
                <div class="col-md-9">
                    <h2 style="padding: 0;margin:0">
                        <small>
                            收货地址
                        </small>
                    </h2>
                    <hr>
                        <button class="btn btn-primary" data-target="#modal-1" data-toggle="modal" style="margin: 0">
                            添加新地址
                        </button>
                        <div class="modal fade" id="modal-1">
                            <div class="modal-dialog" role="document">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button aria-label="Close" class="close" data-dismiss="modal" type="button">
                                            <span aria-hidden="true">
                                                ×
                                            </span>
                                            <span class="sr-only">
                                                Close
                                            </span>
                                        </button>
                                        <h4 class="modal-title">
                                            添加新地址
                                        </h4>
                                    </div>
                                    <div class="modal-body">
                                        <form action="{{ route('checkout-data') }}" class="form-box" method="post">
                                            {{csrf_field()}}
                                            <div class="panel-body">
                                                <div class="form-group col-sm-4">
                                                    <select class="form-control" id="country" name="country">
                                                        <option value="0">
                                                            请选择国家
                                                        </option>
                                                        <option value="中国">
                                                            中国
                                                        </option>
                                                    </select>
                                                    <span style="color:red;">
                                                        {{$errors->first('country')}}
                                                    </span>
                                                </div>
                                                <div class="form-group col-sm-4">
                                                    <input class="form-control" name="state" placeholder="省" type="text">
                                                        <span style="color:red;">
                                                            {{$errors->first('state')}}
                                                        </span>
                                                    </input>
                                                </div>
                                                <div class="form-group col-sm-4">
                                                    <input class="form-control" name="city" placeholder="市" type="text">
                                                        <span style="color:red;">
                                                            {{$errors->first('city')}}
                                                        </span>
                                                    </input>
                                                </div>
                                                <div class="form-group col-sm-12">
                                                    <input class="form-control" id="pincode" name="pincode" placeholder="邮政编码" type="text">
                                                        <span style="color:red;">
                                                            {{$errors->first('pincode')}}
                                                        </span>
                                                    </input>
                                                </div>
                                                <div class="form-group col-sm-12">
                                                    <input class="form-control" name="fullname" placeholder="详细地址" type="text">
                                                        <span style="color:red;">
                                                            {{$errors->first('fullname')}}
                                                        </span>
                                                    </input>
                                                </div>
                                                <div class="form-group col-sm-12">
                                                    <button class="btn btn-primary" type="submit">
                                                        确定
                                                    </button>
                                                </div>
                                            </div> 
                                        </form>
                                    </div> 
                                </div>
                                <!-- /.modal-content -->
                            </div>
                            <!-- /.modal-dialog -->
                        </div>
                        <!-- /.modal -->
                        <div class="list-group">
                            @foreach($adresses as $adress)
                            <li class="list-group-item">
                                {{$loop->index+1}}.{{$adress->country}}, {{$adress->state}}, {{$adress->city}} {{$adress->fullname}} {{$adress->pincode}}
                            </li>
                            @endforeach
                        </div>
                    </hr>
                </div>
            </div>
        </div>
        @include('front.layouts.script-src')
    </body>
</html>
